package com.beyond.trace.dy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.beyond.trace.dy.mapper.TraceDyProduceMapper;
import com.beyond.trace.dy.domain.TraceDyProduce;
import com.beyond.trace.dy.service.ITraceDyProduceService;

/**
 * 生产加工单Service业务层处理
 * 
 * @author Mr.Yao
 * @date 2022-04-09
 */
@Service
public class TraceDyProduceServiceImpl extends ServiceImpl<TraceDyProduceMapper, TraceDyProduce> implements ITraceDyProduceService
{
    @Resource
    private TraceDyProduceMapper traceDyProduceMapper;

    /**
     * 查询生产加工单
     * 
     * @param produceId 生产加工单ID
     * @return 生产加工单
     */
    @Override
    public TraceDyProduce selectTraceDyProduceById(Long produceId)
    {
        return traceDyProduceMapper.selectTraceDyProduceById(produceId);
    }

    /**
     * 查询生产加工单列表
     * 
     * @param traceDyProduce 生产加工单
     * @return 生产加工单
     */
    @Override
    public List<TraceDyProduce> selectTraceDyProduceList(TraceDyProduce traceDyProduce)
    {
        return traceDyProduceMapper.selectTraceDyProduceList(traceDyProduce);
    }

    /**
     * 新增生产加工单
     * 
     * @param traceDyProduce 生产加工单
     * @return 结果
     */
    @Override
    public boolean insertTraceDyProduce(TraceDyProduce traceDyProduce)
    {
        traceDyProduce.setCreateTime(DateUtils.getNowDate());
        //return traceDyProduceMapper.insertTraceDyProduce(traceDyProduce);
        return super.save(traceDyProduce);
    }

    /**
     * 修改生产加工单
     * 
     * @param traceDyProduce 生产加工单
     * @return 结果
     */
    @Override
    public int updateTraceDyProduce(TraceDyProduce traceDyProduce)
    {
        traceDyProduce.setUpdateTime(DateUtils.getNowDate());
        return traceDyProduceMapper.updateTraceDyProduce(traceDyProduce);
    }

    /**
     * 批量删除生产加工单
     * 
     * @param produceIds 需要删除的生产加工单ID
     * @return 结果
     */
    @Override
    public int deleteTraceDyProduceByIds(Long[] produceIds)
    {
        return traceDyProduceMapper.deleteTraceDyProduceByIds(produceIds);
    }

    /**
     * 删除生产加工单信息
     * 
     * @param produceId 生产加工单ID
     * @return 结果
     */
    @Override
    public int deleteTraceDyProduceById(Long produceId)
    {
        return traceDyProduceMapper.deleteTraceDyProduceById(produceId);
    }
}
